
package models.spider.sink;

import models.spider.ISpider;
import models.spider.request.Request;

public class Failure extends SinkBase {

    protected ISink sink;

    public Failure(final ISink sink) {
        this.sink = sink;
    }

    public Failure() {
        this(EMPTY);
    }

    @Override
    public void sink(final Request request, final ISpider spider) {
        if (!request.isValid()) {
            sink.sink(request, spider);
        }
    }

}
